//
//  YSAccountCenterHeaderView.m
//  Yueshi
//
//  Created by Northwan on 15/7/30.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSAccountCenterHeaderView.h"

@interface YSAccountCenterHeaderView()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@end

@implementation YSAccountCenterHeaderView

+(instancetype)headerView{
    return [[[NSBundle mainBundle]loadNibNamed:@"YSAccountCenterHeaderView" owner:nil options:nil]lastObject];
}

-(void)setAddress:(YSAddress *)address{
    _address = address;
    [self.nameLabel setText:address.addressee];
    [self.phoneLabel setText:address.phoneCode];
    [self.addressLabel setText:address.detailAdres];
}

- (IBAction)tapHead:(UIButton *)sender {
   [[NSNotificationCenter defaultCenter]postNotificationName:kTapAccountCenterAddressHeadNortif object:[NSNumber numberWithInteger:sender.tag]];
}

@end
